package com.demo.modules.controller;

import com.demo.common.Res;
import com.demo.common.utils.UserUtils;
import com.demo.modules.dto.QueryDTO;
import com.demo.modules.entity.VaccinationRecord;
import com.demo.modules.service.VaccinationRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 疫苗接种记录表
 */
@RestController
@RequestMapping("vaccination")
public class VaccinationRecordController {

    @Autowired
    private VaccinationRecordService vaccinationRecordService;

    /**
     * 查询疫苗接种记录列表数据
     * @return
     */
    @GetMapping("list")
    public Res<List<VaccinationRecord>> list(){
        QueryDTO dto = new QueryDTO();
        dto.setUserId(UserUtils.getUserId());
        return Res.success(vaccinationRecordService.list(dto));
    }
}
